namespace mecs {

    export interface ICmd {
        sid: number;
        /** 指令类型 */
        type: number;
        /** 指令所需要的数据,如果cmd=move，data可以为：{x,y,dir} */
        data?: any;
    }

    export interface ILogicFrameData {
        id: number;
        cmds: ICmd[];
    }

    export interface IKeyFrameCache {
        seed: number;
        worldId: number;
        frameId: number;
        logicTime: number;
        entities: ICacheEntity[];
        systems: { [sysName: string]: ICacheSys };
    }

    export interface ICacheEntity {
        sid: number;
        entityName: string;
        comps: {
            [name: string]: any;
        };
    }

    export interface ICacheSys {
        sysName: string;
        mLastTime: number;
        mDeltaTimestamp: number;
        mLastTimestamp: number;
        childs?: { [sysName: string]: ICacheSys };
    }
}